mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-03-12 13:41:52 +00:00
Fixed too-long-mempool-chain handling of kevacoin.
This commit is contained in:
parent
baa887ba65
commit
1112bc2f02
@ -3171,8 +3171,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CCon
|
|||||||
auto rejectReason = state.GetRejectReason();
|
auto rejectReason = state.GetRejectReason();
|
||||||
LogPrintf("CommitTransaction(): Transaction cannot be broadcast immediately, %s\n", rejectReason);
|
LogPrintf("CommitTransaction(): Transaction cannot be broadcast immediately, %s\n", rejectReason);
|
||||||
// TODO: if we expect the failure to be long term or permanent, instead delete wtx from the wallet and return failure.
|
// TODO: if we expect the failure to be long term or permanent, instead delete wtx from the wallet and return failure.
|
||||||
bool isRegTest = Params().NetworkIDString() == CBaseChainParams::REGTEST;
|
if (wtx.tx->IsKevacoin() && rejectReason == "too-long-mempool-chain") {
|
||||||
if (!isRegTest && rejectReason == "too-long-mempool-chain") {
|
|
||||||
LogPrintf("Abandon the too-long-mempool-chain Tx: %s \n", wtx.GetHash().ToString().c_str());
|
LogPrintf("Abandon the too-long-mempool-chain Tx: %s \n", wtx.GetHash().ToString().c_str());
|
||||||
AbandonTransaction(wtx.GetHash());
|
AbandonTransaction(wtx.GetHash());
|
||||||
return false;
|
return false;
|
||||||
|
@ -168,8 +168,9 @@ class KevaTest(BitcoinTestFramework):
|
|||||||
key = secondPrefix + '|' + str(i)
|
key = secondPrefix + '|' + str(i)
|
||||||
value = '-value-' * 320 + '|' + str(i)
|
value = '-value-' * 320 + '|' + str(i)
|
||||||
self.nodes[0].keva_put(namespaceId, key, value)
|
self.nodes[0].keva_put(namespaceId, key, value)
|
||||||
except JSONRPCException:
|
except JSONRPCException as e:
|
||||||
throwException = True
|
if str(e).find("too-long-mempool-chain") >= 0:
|
||||||
|
throwException = True
|
||||||
|
|
||||||
assert(throwException)
|
assert(throwException)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user