Changeset View
Changeset View
Standalone View
Standalone View
src/node/transaction.cpp
Show All 39 Lines | bool callback_set = false; | ||||
// exists in the chain. | // exists in the chain. | ||||
if (!existingCoin.IsSpent()) { | if (!existingCoin.IsSpent()) { | ||||
return TransactionError::ALREADY_IN_CHAIN; | return TransactionError::ALREADY_IN_CHAIN; | ||||
} | } | ||||
} | } | ||||
if (!g_mempool.exists(txid)) { | if (!g_mempool.exists(txid)) { | ||||
// Transaction is not already in the mempool. Submit it. | // Transaction is not already in the mempool. Submit it. | ||||
CValidationState state; | TxValidationState state; | ||||
if (!AcceptToMemoryPool(config, g_mempool, state, std::move(tx), | if (!AcceptToMemoryPool(config, g_mempool, state, std::move(tx), | ||||
false /* bypass_limits */, max_tx_fee)) { | false /* bypass_limits */, max_tx_fee)) { | ||||
err_string = FormatStateMessage(state); | err_string = FormatStateMessage(state); | ||||
if (state.IsInvalid()) { | if (state.IsInvalid()) { | ||||
if (state.GetReason() == | if (state.GetResult() == | ||||
ValidationInvalidReason::TX_MISSING_INPUTS) { | TxValidationResult::TX_MISSING_INPUTS) { | ||||
return TransactionError::MISSING_INPUTS; | return TransactionError::MISSING_INPUTS; | ||||
} | } | ||||
return TransactionError::MEMPOOL_REJECTED; | return TransactionError::MEMPOOL_REJECTED; | ||||
} | } | ||||
return TransactionError::MEMPOOL_ERROR; | return TransactionError::MEMPOOL_ERROR; | ||||
} | } | ||||
// Transaction was accepted to the mempool. | // Transaction was accepted to the mempool. | ||||
Show All 29 Lines |