doublecheck RPC

This commit is contained in:
Michel van Kessel
2020-12-23 17:15:32 +01:00
parent 237699b431
commit ea7971fcdc
9 changed files with 379 additions and 380 deletions

View File

@@ -1,7 +1,7 @@
[
["Format is: [scriptSig, scriptPubKey, flags, expected_scripterror, ... comments]"],
["It is evaluated as if there was a crediting coinbase transaction with two 0"],
["pushes as scriptSig, and one output of 0 satoshi and given scriptPubKey,"],
["pushes as scriptSig, and one output of 0 blacktoshi and given scriptPubKey,"],
["followed by a spending transaction which spends this output as only input (and"],
["correct prevout hash), using the given scriptSig. All nLockTimes are 0, all"],
["nSequences are max."],

View File

@@ -101,7 +101,7 @@ void TestPackageSelection(const CChainParams& chainparams, CScript scriptPubKey,
// This tx has a high fee, but depends on the first transaction
tx.vin[0].prevout.hash = hashParentTx;
tx.vout[0].nValue = 5000000000LL - 1000 - 50000; // 50k satoshi fee
tx.vout[0].nValue = 5000000000LL - 1000 - 50000; // 50k blacktoshi fee
uint256 hashHighFeeTx = tx.GetHash();
mempool.addUnchecked(hashHighFeeTx, entry.Fee(50000).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));
@@ -172,7 +172,7 @@ void TestPackageSelection(const CChainParams& chainparams, CScript scriptPubKey,
// This tx will be mineable, and should cause hashLowFeeTx2 to be selected
// as well.
tx.vin[0].prevout.n = 1;
tx.vout[0].nValue = 100000000 - 10000; // 10k satoshi fee
tx.vout[0].nValue = 100000000 - 10000; // 10k blacktoshi fee
mempool.addUnchecked(tx.GetHash(), entry.Fee(10000).FromTx(tx));
pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey);
BOOST_CHECK(pblocktemplate->block.vtx[8].GetHash() == hashLowFeeTx2);