Skip to content

Fix locking for getmempoolentry RPC command

Andrea Suisani requested to merge sickpig/BCHUnlimited:fix-getmempoolentry into dev
  • Fix getmempoolentry by adding WRITELOCK

    We are updating tx chain state and so need a write lock rather
    than a read lock. Somehow this was not getting picked up by
    the assertwritelockheld() on L422 in txmempool.cpp

  • Add second lookup in getmempoolentry

    By using a second lookup in getmempoolentry, if and only if the
    initial lookup shows that the entry is dirty, then we can in
    almost all cases only require a READLOCK and one lookup but
    if the transactions chain is longer that 500 then we can still
    update it correctly and return the correct state.

Merge request reports