|
|
@ -822,7 +822,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)
|
|
|
|
|
|
|
|
|
|
|
|
void CWallet::LoadToWallet(CWalletTx& wtxIn)
|
|
|
|
void CWallet::LoadToWallet(CWalletTx& wtxIn)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// If wallet doesn't have a chain (e.g wallet-tool), lock can't be taken.
|
|
|
|
// If wallet doesn't have a chain (e.g bitcoin-wallet), lock can't be taken.
|
|
|
|
auto locked_chain = LockChain();
|
|
|
|
auto locked_chain = LockChain();
|
|
|
|
if (locked_chain) {
|
|
|
|
if (locked_chain) {
|
|
|
|
Optional<int> block_height = locked_chain->getBlockHeight(wtxIn.m_confirm.hashBlock);
|
|
|
|
Optional<int> block_height = locked_chain->getBlockHeight(wtxIn.m_confirm.hashBlock);
|
|
|
@ -2944,7 +2944,7 @@ DBErrors CWallet::LoadWallet(bool& fFirstRunRet)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Even if we don't use this lock in this function, we want to preserve
|
|
|
|
// Even if we don't use this lock in this function, we want to preserve
|
|
|
|
// lock order in LoadToWallet if query of chain state is needed to know
|
|
|
|
// lock order in LoadToWallet if query of chain state is needed to know
|
|
|
|
// tx status. If lock can't be taken (e.g wallet-tool), tx confirmation
|
|
|
|
// tx status. If lock can't be taken (e.g bitcoin-wallet), tx confirmation
|
|
|
|
// status may be not reliable.
|
|
|
|
// status may be not reliable.
|
|
|
|
auto locked_chain = LockChain();
|
|
|
|
auto locked_chain = LockChain();
|
|
|
|
LOCK(cs_wallet);
|
|
|
|
LOCK(cs_wallet);
|
|
|
|