From c73c3af70b25207b0fe0a91f1fbf1e7b034721b1 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 26 May 2023 08:59:20 -0600 Subject: [PATCH] fix: namecoin tx signing --- .../coins/namecoin/namecoin_wallet.dart | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/services/coins/namecoin/namecoin_wallet.dart b/lib/services/coins/namecoin/namecoin_wallet.dart index ebb3a9822..507d276a3 100644 --- a/lib/services/coins/namecoin/namecoin_wallet.dart +++ b/lib/services/coins/namecoin/namecoin_wallet.dart @@ -2803,19 +2803,18 @@ class NamecoinWallet extends CoinServiceAPI // Add transaction output 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 { // Sign the transaction accordingly for (var i = 0; i < utxoSigningData.length; i++) { - final txid = utxoSigningData[i].utxo.txid; - txb.addInput( - txid, - utxoSigningData[i].utxo.vout, - null, - utxoSigningData[i].output!, - _network.bech32!, + txb.sign( + vin: i, + keyPair: utxoSigningData[i].keyPair!, + witnessValue: utxoSigningData[i].utxo.value, + redeemScript: utxoSigningData[i].redeemScript, + overridePrefix: _network.bech32!, ); } } catch (e, s) { @@ -2824,7 +2823,7 @@ class NamecoinWallet extends CoinServiceAPI rethrow; } - final builtTx = txb.build(namecoin.bech32!); + final builtTx = txb.build(_network.bech32!); final vSize = builtTx.virtualSize(); return {"hex": builtTx.toHex(), "vSize": vSize};