optimize redeemscript map generation
This commit is contained in:
parent
53e0371b7f
commit
326384cd4b
8 changed files with 48 additions and 35 deletions
|
|
@ -144,7 +144,6 @@ describe('TxProposals model', function() {
|
|||
|
||||
var b = new Builder(opts)
|
||||
.setUnspent(utxos)
|
||||
.setHashToScriptMap(pkr.getRedeemScriptMap())
|
||||
.setOutputs([{
|
||||
address: toAddress,
|
||||
amountSat: amountSat
|
||||
|
|
@ -154,6 +153,12 @@ describe('TxProposals model', function() {
|
|||
return pkr.pathForAddress(utxo.address);
|
||||
});
|
||||
|
||||
var selectedUtxos = b.getSelectedUnspent();
|
||||
var inputChainPaths = selectedUtxos.map(function(utxo) {
|
||||
return pkr.pathForAddress(utxo.address);
|
||||
});
|
||||
b.setHashToScriptMap(pkr.getRedeemScriptMap(inputChainPaths));
|
||||
|
||||
var signRet;
|
||||
if (priv) {
|
||||
var pkeys = priv.getForPaths(inputChainPaths);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue