dusk-network / rusk

The reference Dusk platform implementation and tools
Mozilla Public License 2.0
155 stars 59 forks source link

Deleting from immutable view of the database #2124

Closed HDauven closed 1 month ago

HDauven commented 1 month ago

Summary

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.

goshawk-3 commented 1 month ago

Resolved in https://github.com/dusk-network/rusk/pull/2091/commits/8110ccff85bf03d045af6989c54ac2d4bc657084