mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Add more proper thread safety annotations
This commit is contained in:
@@ -1841,6 +1841,8 @@ void CWallet::ReacceptWalletTransactions()
|
||||
|
||||
bool CWallet::SubmitTxMemoryPoolAndRelay(CWalletTx& wtx, std::string& err_string, bool relay) const
|
||||
{
|
||||
AssertLockHeld(cs_wallet);
|
||||
|
||||
// Can't relay if wallet is not broadcasting
|
||||
if (!GetBroadcastTransactions()) return false;
|
||||
// Don't relay abandoned transactions
|
||||
@@ -3126,8 +3128,11 @@ int CWallet::GetTxDepthInMainChain(const CWalletTx& wtx) const
|
||||
|
||||
int CWallet::GetTxBlocksToMaturity(const CWalletTx& wtx) const
|
||||
{
|
||||
if (!wtx.IsCoinBase())
|
||||
AssertLockHeld(cs_wallet);
|
||||
|
||||
if (!wtx.IsCoinBase()) {
|
||||
return 0;
|
||||
}
|
||||
int chain_depth = GetTxDepthInMainChain(wtx);
|
||||
assert(chain_depth >= 0); // coinbase tx should not be conflicted
|
||||
return std::max(0, (COINBASE_MATURITY+1) - chain_depth);
|
||||
@@ -3135,6 +3140,8 @@ int CWallet::GetTxBlocksToMaturity(const CWalletTx& wtx) const
|
||||
|
||||
bool CWallet::IsTxImmatureCoinBase(const CWalletTx& wtx) const
|
||||
{
|
||||
AssertLockHeld(cs_wallet);
|
||||
|
||||
// note GetBlocksToMaturity is 0 for non-coinbase tx
|
||||
return GetTxBlocksToMaturity(wtx) > 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user