Browse Source

Mining test cases passed.

cn
Jianping Wu 6 years ago
parent
commit
4c92689288
  1. 8
      src/consensus/tx_verify.cpp
  2. 2
      test/functional/mining_basic.py

8
src/consensus/tx_verify.cpp

@ -208,16 +208,16 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fChe
bool Consensus::CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoinsViewCache& inputs, int nSpendHeight, unsigned flags, CAmount& txfee) bool Consensus::CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoinsViewCache& inputs, int nSpendHeight, unsigned flags, CAmount& txfee)
{ {
if (!CheckKevaTransaction (tx, nSpendHeight, inputs, state, flags)) {
return state.Invalid(false, 0, "", "Tx invalid for Kevacoin");
}
// are the actual inputs available? // are the actual inputs available?
if (!inputs.HaveInputs(tx)) { if (!inputs.HaveInputs(tx)) {
return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-missingorspent", false, return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-missingorspent", false,
strprintf("%s: inputs missing/spent", __func__)); strprintf("%s: inputs missing/spent", __func__));
} }
if (!CheckKevaTransaction (tx, nSpendHeight, inputs, state, flags)) {
return state.Invalid(false, 0, "", "Tx invalid for Kevacoin");
}
CAmount nValueIn = 0; CAmount nValueIn = 0;
for (unsigned int i = 0; i < tx.vin.size(); ++i) { for (unsigned int i = 0; i < tx.vin.size(); ++i) {
const COutPoint &prevout = tx.vin[i].prevout; const COutPoint &prevout = tx.vin[i].prevout;

2
test/functional/mining_basic.py

@ -40,7 +40,7 @@ class MiningTest(BitcoinTestFramework):
assert_equal(mining_info['chain'], 'regtest') assert_equal(mining_info['chain'], 'regtest')
assert_equal(mining_info['currentblocktx'], 0) assert_equal(mining_info['currentblocktx'], 0)
assert_equal(mining_info['currentblockweight'], 0) assert_equal(mining_info['currentblockweight'], 0)
assert_equal(mining_info['difficulty'], Decimal('4.656542373906925E-10')) assert_equal(mining_info['difficulty'], Decimal('0.0004882738576261828'))
assert_equal(mining_info['networkhashps'], Decimal('0.003333333333333334')) assert_equal(mining_info['networkhashps'], Decimal('0.003333333333333334'))
assert_equal(mining_info['pooledtx'], 0) assert_equal(mining_info['pooledtx'], 0)

Loading…
Cancel
Save