btcsuite / btcwallet

A secure bitcoin wallet daemon written in Go (golang)
ISC License
1.15k stars 590 forks source link

Handle mempool minimum fee error #871

Closed ziggie1984 closed 1 year ago

ziggie1984 commented 1 year ago

Relates to https://github.com/lightningnetwork/lnd/issues/7156. and https://github.com/lightninglabs/neutrino/pull/278

This PR introduces a new error which handles the case where our backend reports either a min relay fee not met error or a mempool min fee not met. I decided to go with a new error because handling this case as a ErrDoubleSpend feels not right because it is not really a doublespend. One could decide whether we want to include the min relay fee not met case, but this was a nice way to test it locally, but I find it reasonable to include it too.

With this PR in place we can check for this error in higher level software like lnd and behave differently in some situations as menitoned in https://github.com/lightningnetwork/lnd/issues/7156.