Merge branch 'master' into trimSpace
This commit is contained in:
commit
9aa2842123
10 changed files with 1181 additions and 1154 deletions
|
@ -29,6 +29,7 @@ class TransactionBuilder {
|
|||
this.__INPUTS = [];
|
||||
this.__TX = new transaction_1.Transaction();
|
||||
this.__TX.version = 2;
|
||||
this.__USE_LOW_R = false;
|
||||
}
|
||||
static fromTransaction(transaction, network) {
|
||||
const txb = new TransactionBuilder(network);
|
||||
|
@ -53,6 +54,14 @@ class TransactionBuilder {
|
|||
});
|
||||
return txb;
|
||||
}
|
||||
setLowR(setting) {
|
||||
typeforce(typeforce.maybe(typeforce.Boolean), setting);
|
||||
if (setting === undefined) {
|
||||
setting = true;
|
||||
}
|
||||
this.__USE_LOW_R = setting;
|
||||
return setting;
|
||||
}
|
||||
setLockTime(locktime) {
|
||||
typeforce(types.UInt32, locktime);
|
||||
// if any signatures exist, throw
|
||||
|
@ -172,7 +181,7 @@ class TransactionBuilder {
|
|||
'BIP143 rejects uncompressed public keys in P2WPKH or P2WSH',
|
||||
);
|
||||
}
|
||||
const signature = keyPair.sign(signatureHash);
|
||||
const signature = keyPair.sign(signatureHash, this.__USE_LOW_R);
|
||||
input.signatures[i] = bscript.signature.encode(signature, hashType);
|
||||
return true;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue