From 97f4bad4a29588de42220efae06e0bbc2fc05aae Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Thu, 16 Feb 2017 13:51:05 -0500 Subject: [PATCH] Fix wallet accounting and txn construction corner cases --- src/wallet/wallet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 82db94fc01..7dc68c8b89 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1523,7 +1523,7 @@ void CWalletTx::GetAmounts(list& listReceived, COutputEntry output = {address, nValueOut, assetID, (int)i, GetBlindingPubKey(i)}; // If we are debited by the transaction, add the output as a "sent" entry - if (nDebit > CAmountMap()) + if (nDebit > CAmountMap() && !txout.IsFee()) listSent.push_back(output); // If we are receiving the output, add it as a "received" entry @@ -2905,6 +2905,7 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt output_pubkeys.push_back(GetBlindingPubKey(newTxOut.scriptPubKey)); output_blinds.push_back(uint256()); output_asset_blinds.push_back(uint256()); + output_asset_ids.push_back(BITCOINID); vAmounts.push_back(0); // Now it has to succeed bool ret = BlindOutputs(input_blinds, input_asset_blinds, input_asset_ids, input_amounts, output_blinds, output_asset_blinds, output_pubkeys, txNew);