mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 01:37:54 +00:00
fix: namecoin tx signing
This commit is contained in:
parent
990cc7cfa5
commit
c73c3af70b
1 changed files with 8 additions and 9 deletions
|
@ -2803,19 +2803,18 @@ class NamecoinWallet extends CoinServiceAPI
|
||||||
|
|
||||||
// Add transaction output
|
// Add transaction output
|
||||||
for (var i = 0; i < recipients.length; i++) {
|
for (var i = 0; i < recipients.length; i++) {
|
||||||
txb.addOutput(recipients[i], satoshiAmounts[i], namecoin.bech32!);
|
txb.addOutput(recipients[i], satoshiAmounts[i], _network.bech32!);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Sign the transaction accordingly
|
// Sign the transaction accordingly
|
||||||
for (var i = 0; i < utxoSigningData.length; i++) {
|
for (var i = 0; i < utxoSigningData.length; i++) {
|
||||||
final txid = utxoSigningData[i].utxo.txid;
|
txb.sign(
|
||||||
txb.addInput(
|
vin: i,
|
||||||
txid,
|
keyPair: utxoSigningData[i].keyPair!,
|
||||||
utxoSigningData[i].utxo.vout,
|
witnessValue: utxoSigningData[i].utxo.value,
|
||||||
null,
|
redeemScript: utxoSigningData[i].redeemScript,
|
||||||
utxoSigningData[i].output!,
|
overridePrefix: _network.bech32!,
|
||||||
_network.bech32!,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
|
@ -2824,7 +2823,7 @@ class NamecoinWallet extends CoinServiceAPI
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
final builtTx = txb.build(namecoin.bech32!);
|
final builtTx = txb.build(_network.bech32!);
|
||||||
final vSize = builtTx.virtualSize();
|
final vSize = builtTx.virtualSize();
|
||||||
|
|
||||||
return {"hex": builtTx.toHex(), "vSize": vSize};
|
return {"hex": builtTx.toHex(), "vSize": vSize};
|
||||||
|
|
Loading…
Reference in a new issue