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; | ||||
bool fMissingInputs; | |||||
if (!AcceptToMemoryPool(config, g_mempool, state, std::move(tx), | if (!AcceptToMemoryPool(config, g_mempool, state, std::move(tx), | ||||
&fMissingInputs, false /* bypass_limits */, | false /* bypass_limits */, max_tx_fee)) { | ||||
max_tx_fee)) { | |||||
if (state.IsInvalid()) { | |||||
err_string = FormatStateMessage(state); | err_string = FormatStateMessage(state); | ||||
return TransactionError::MEMPOOL_REJECTED; | if (state.IsInvalid()) { | ||||
} | if (state.GetResult() == | ||||
TxValidationResult::TX_MISSING_INPUTS) { | |||||
if (fMissingInputs) { | |||||
return TransactionError::MISSING_INPUTS; | return TransactionError::MISSING_INPUTS; | ||||
} | } | ||||
return TransactionError::MEMPOOL_REJECTED; | |||||
err_string = FormatStateMessage(state); | } | ||||
return TransactionError::MEMPOOL_ERROR; | return TransactionError::MEMPOOL_ERROR; | ||||
} | } | ||||
// Transaction was accepted to the mempool. | // Transaction was accepted to the mempool. | ||||
if (wait_callback) { | if (wait_callback) { | ||||
// For transactions broadcast from outside the wallet, make sure | // For transactions broadcast from outside the wallet, make sure | ||||
// that the wallet has been notified of the transaction before | // that the wallet has been notified of the transaction before | ||||
Show All 25 Lines |