ported Bitcoin PR 7229 to resolve Issue #16

This commit is contained in:
jahway603
2023-11-22 16:55:19 -05:00
parent 4887fa6447
commit f5f52a7e81
2 changed files with 7 additions and 2 deletions

View File

@@ -221,7 +221,7 @@ class WalletTest (BitcoinTestFramework):
for uTx in unspentTxs: for uTx in unspentTxs:
if uTx['txid'] == zeroValueTxid: if uTx['txid'] == zeroValueTxid:
found = True found = True
assert_equal(uTx['amount'], Decimal('0.00000000')) assert_equal(uTx['amount'], Decimal('0'))
assert(found) assert(found)
#do some -walletbroadcast tests #do some -walletbroadcast tests

View File

@@ -1233,8 +1233,13 @@ bool CWalletDB::Recover(CDBEnv& dbenv, const std::string& filename, bool fOnlyKe
CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION); CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION);
CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION); CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION);
string strType, strErr; string strType, strErr;
bool fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue, bool fReadOK;
{
// Required in LoadKeyMetadata():
LOCK(dummyWallet.cs_wallet);
fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue,
wss, strType, strErr); wss, strType, strErr);
}
if (!IsKeyType(strType)) if (!IsKeyType(strType))
continue; continue;
if (!fReadOK) if (!fReadOK)