mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Add height, depth, and hash methods to the Chain interface
And use them to remove uses of chainActive and mapBlockIndex in wallet code This commit does not change behavior. Co-authored-by: Ben Woosley <ben.woosley@gmail.com>
This commit is contained in:
@@ -276,7 +276,7 @@ static int64_t AddTx(CWallet& wallet, uint32_t lockTime, int64_t mockTime, int64
|
||||
|
||||
CWalletTx wtx(&wallet, MakeTransactionRef(tx));
|
||||
if (block) {
|
||||
wtx.SetMerkleBranch(block, 0);
|
||||
wtx.SetMerkleBranch(block->GetBlockHash(), 0);
|
||||
}
|
||||
{
|
||||
LOCK(cs_main);
|
||||
@@ -372,7 +372,7 @@ public:
|
||||
LOCK(wallet->cs_wallet);
|
||||
auto it = wallet->mapWallet.find(tx->GetHash());
|
||||
BOOST_CHECK(it != wallet->mapWallet.end());
|
||||
it->second.SetMerkleBranch(chainActive.Tip(), 1);
|
||||
it->second.SetMerkleBranch(chainActive.Tip()->GetBlockHash(), 1);
|
||||
return it->second;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user