mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-13 00:28:03 +00:00
Mining test cases passed.
This commit is contained in:
parent
0c6a908f7c
commit
4c92689288
@ -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;
|
||||||
|
@ -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…
Reference in New Issue
Block a user