mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28: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:
@@ -333,7 +333,7 @@ public:
|
||||
if (mi == m_wallet.mapWallet.end()) {
|
||||
return false;
|
||||
}
|
||||
num_blocks = ::chainActive.Height();
|
||||
num_blocks = locked_chain->getHeight().value_or(-1);
|
||||
block_time = ::chainActive.Tip()->GetBlockTime();
|
||||
tx_status = MakeWalletTxStatus(*locked_chain, mi->second);
|
||||
return true;
|
||||
@@ -348,7 +348,7 @@ public:
|
||||
LOCK(m_wallet.cs_wallet);
|
||||
auto mi = m_wallet.mapWallet.find(txid);
|
||||
if (mi != m_wallet.mapWallet.end()) {
|
||||
num_blocks = ::chainActive.Height();
|
||||
num_blocks = locked_chain->getHeight().value_or(-1);
|
||||
in_mempool = mi->second.InMempool();
|
||||
order_form = mi->second.vOrderForm;
|
||||
tx_status = MakeWalletTxStatus(*locked_chain, mi->second);
|
||||
@@ -379,7 +379,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
balances = getBalances();
|
||||
num_blocks = ::chainActive.Height();
|
||||
num_blocks = locked_chain->getHeight().value_or(-1);
|
||||
return true;
|
||||
}
|
||||
CAmount getBalance() override { return m_wallet.GetBalance(); }
|
||||
|
||||
Reference in New Issue
Block a user