Skip to content

Commit bcaba64

Browse files
authored
Merge pull request bitcoin#15 from bitgreen/corruptionissue
Recent wallet issues
2 parents 6f9c6a1 + 3cec657 commit bcaba64

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AC_PREREQ([2.60])
33
define(_CLIENT_VERSION_MAJOR, 1)
44
define(_CLIENT_VERSION_MINOR, 4)
55
define(_CLIENT_VERSION_REVISION, 0)
6-
define(_CLIENT_VERSION_BUILD, 3)
6+
define(_CLIENT_VERSION_BUILD, 4)
77
define(_CLIENT_VERSION_RC, 0)
88
define(_CLIENT_VERSION_IS_RELEASE, true)
99
define(_COPYRIGHT_YEAR, 2019)

src/validation.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,10 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
627627

628628
// No transactions are allowed below minRelayTxFee except from disconnected blocks
629629
if (!bypass_limits && nModifiedFees < ::minRelayTxFee.GetFee(nSize)) {
630+
if (tx.nType == TRANSACTION_PROVIDER_REGISTER) {
631+
std::string strReason = "Did you remember to specify a funding address with adequate balance?";
632+
return state.Invalid(ValidationInvalidReason::TX_MEMPOOL_POLICY, false, REJECT_INSUFFICIENTFEE, "min relay fee not met (%s)", strReason);
633+
}
630634
return state.Invalid(ValidationInvalidReason::TX_MEMPOOL_POLICY, false, REJECT_INSUFFICIENTFEE, "min relay fee not met", strprintf("%d < %d", nModifiedFees, ::minRelayTxFee.GetFee(nSize)));
631635
}
632636

@@ -3167,6 +3171,10 @@ CBlockIndex* BlockManager::AddToBlockIndex(const CBlockHeader& block, bool fProo
31673171
pindexNew->nStatus |= nStatus;
31683172
}
31693173

3174+
// set pos flag if it wasnt set
3175+
if (!block.nNonce)
3176+
pindexNew->SetProofOfStake();
3177+
31703178
setDirtyBlockIndex.insert(pindexNew);
31713179

31723180
// track prevBlockHash -> pindex (multimap)

src/wallet/wallet.cpp

+10-8
Original file line numberDiff line numberDiff line change
@@ -2186,9 +2186,6 @@ CWallet::ScanResult CWallet::ScanForWalletTransactions(const uint256& start_bloc
21862186

21872187
void CWallet::ReacceptWalletTransactions(interfaces::Chain::Lock& locked_chain)
21882188
{
2189-
// If transactions aren't being broadcasted, don't let them into local mempool either
2190-
if (!fBroadcastTransactions)
2191-
return;
21922189
std::map<int64_t, CWalletTx*> mapSorted;
21932190

21942191
// Sort pending wallet transactions based on their initial wallet insertion order
@@ -2200,11 +2197,16 @@ void CWallet::ReacceptWalletTransactions(interfaces::Chain::Lock& locked_chain)
22002197

22012198
int nDepth = wtx.GetDepthInMainChain(locked_chain);
22022199

2203-
if (nDepth == 0 && !wtx.isAbandoned() && !wtx.IsLockedByInstantSend()) {
2204-
if (wtx.IsCoinBase() || wtx.IsCoinStake())
2205-
AbandonTransaction(locked_chain, wtxid);
2206-
else
2207-
mapSorted.insert(std::make_pair(wtx.nOrderPos, &wtx));
2200+
if (nDepth == 0 && !wtx.isAbandoned()) {
2201+
if (!wtx.IsLockedByInstantSend()) {
2202+
if (wtx.IsCoinBase() || wtx.IsCoinStake()) {
2203+
// dont try to put orphaned stakes/coinbase back into mempool
2204+
AbandonTransaction(locked_chain, wtxid);
2205+
return;
2206+
} else {
2207+
mapSorted.insert(std::make_pair(wtx.nOrderPos, &wtx));
2208+
}
2209+
}
22082210
}
22092211
}
22102212

0 commit comments

Comments
 (0)