Within node/src/mempool.rs:126:155, the accept_tx function is implemented to
accept new transactions into the node's mempool. On line 140, the variable view is
introduced, representing a read-only view of the database. Starting with line 155, the code
iterates through all transactions in the database identified by the nullifiers of the transaction
being accepted. If a transaction's gas price is lower than that of the accepted transaction, it is
removed from the view on line 158.
However, this operation has no effect because the view is read-only.
Solution
We recommend using the update function to obtain a mutable view of the database.
Summary
Within
node/src/mempool.rs:126:155
, theaccept_tx
function is implemented to accept new transactions into the node's mempool. On line 140, the variable view is introduced, representing a read-only view of the database. Starting with line 155, the code iterates through all transactions in the database identified by the nullifiers of the transactionbeing accepted. If a transaction's gas price is lower than that of the accepted transaction, it is removed from the view on line 158. However, this operation has no effect because the view is read-only.
Solution
We recommend using the
update
function to obtain a mutable view of the database.