Fix locking for getmempoolentry RPC command
-
Fix
getmempoolentry
by addingWRITELOCK
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
theassertwritelockheld()
on L422 intxmempool.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 aREADLOCK
and one lookup but
if the transactions chain is longer that 500 then we can still
update it correctly and return the correct state.