diff options
| author | tobtoht <tob@featherwallet.org> | 2025-03-10 16:20:00 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2025-03-10 16:20:00 +0000 |
| commit | 3da68db9789697d30dc309df2f1da5d348bc4ce2 (patch) | |
| tree | 68c98fab9146797007ab778cdb4a609e1e41f43c /src/cryptonote_core/tx_pool.h | |
| parent | 0232839913b13cf0ab0bb7ad25fff0c05f37d2fe (diff) | |
| parent | 008ba966da88f073f226b299533faca905ceabf8 (diff) | |
| download | monzero-core-3da68db9789697d30dc309df2f1da5d348bc4ce2.tar.gz monzero-core-3da68db9789697d30dc309df2f1da5d348bc4ce2.tar.xz monzero-core-3da68db9789697d30dc309df2f1da5d348bc4ce2.zip | |
Merge pull request #9740
008ba966d blockchain sync: reduce disk writes from 2 to 1 per tx (jeffro256)
Diffstat (limited to 'src/cryptonote_core/tx_pool.h')
| -rw-r--r-- | src/cryptonote_core/tx_pool.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/cryptonote_core/tx_pool.h b/src/cryptonote_core/tx_pool.h index b295ac1c2..df79aea1d 100644 --- a/src/cryptonote_core/tx_pool.h +++ b/src/cryptonote_core/tx_pool.h @@ -113,7 +113,9 @@ namespace cryptonote * @tx_relay how the transaction was received * @param tx_weight the transaction's weight */ - bool add_tx(transaction &tx, const crypto::hash &id, const cryptonote::blobdata &blob, size_t tx_weight, tx_verification_context& tvc, relay_method tx_relay, bool relayed, uint8_t version); + bool add_tx(transaction &tx, const crypto::hash &id, const cryptonote::blobdata &blob, + size_t tx_weight, tx_verification_context& tvc, relay_method tx_relay, bool relayed, + uint8_t version, uint8_t nic_verified_hf_version = 0); /** * @brief add a transaction to the transaction pool @@ -128,10 +130,18 @@ namespace cryptonote * @tx_relay how the transaction was received * @param relayed was this transaction from the network or a local client? * @param version the version used to create the transaction + * @param nic_verified_hf_version hard fork which "tx" is known to pass non-input consensus test + * + * If "nic_verified_hf_version" parameter is equal to "version" parameter, then we skip the + * asserting `ver_non_input_consensus(tx)`, which greatly speeds up block popping and returning + * txs to mempool for txs which we know will pass the test. If nothing is known about how "tx" + * passes the non-input consensus tests (e.g. for newly received relayed txs), then leave + * "nic_verified_hf_version" as its default value of 0 (there is no v0 fork). * * @return true if the transaction passes validations, otherwise false */ - bool add_tx(transaction &tx, tx_verification_context& tvc, relay_method tx_relay, bool relayed, uint8_t version); + bool add_tx(transaction &tx, tx_verification_context& tvc, relay_method tx_relay, bool relayed, + uint8_t version, uint8_t nic_verified_hf_version = 0); /** * @brief takes a transaction with the given hash from the pool @@ -145,10 +155,11 @@ namespace cryptonote * @param do_not_relay return-by-reference is transaction not to be relayed to the network? * @param double_spend_seen return-by-reference was a double spend seen for that transaction? * @param pruned return-by-reference is the tx pruned + * @param suppress_missing_msgs suppress warning msgs when txid is missing (optional, defaults to `false`) * * @return true unless the transaction cannot be found in the pool */ - bool take_tx(const crypto::hash &id, transaction &tx, cryptonote::blobdata &txblob, size_t& tx_weight, uint64_t& fee, bool &relayed, bool &do_not_relay, bool &double_spend_seen, bool &pruned); + bool take_tx(const crypto::hash &id, transaction &tx, cryptonote::blobdata &txblob, size_t& tx_weight, uint64_t& fee, bool &relayed, bool &do_not_relay, bool &double_spend_seen, bool &pruned, bool suppress_missing_msgs = false); /** * @brief checks if the pool has a transaction with the given hash |
