Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harden moving funds against edge cases #3813

Merged
merged 7 commits into from
May 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Corrected comment
tomaszslabon committed May 6, 2024
commit 506d878ef2841d95fad62a66c61334a98735f400
6 changes: 3 additions & 3 deletions pkg/tbtc/moving_funds.go
Original file line number Diff line number Diff line change
@@ -471,7 +471,6 @@ func (mfa *movingFundsAction) actionType() WalletActionType {

func isWalletPendingMovingFundsTarget(
walletPublicKeyHash [20]byte,

chain interface {
BlockCounter() (chain.BlockCounter, error)

@@ -542,8 +541,9 @@ func isWalletPendingMovingFundsTarget(
continue
}

// Our wallet is on the list of target wallets. If the state is moving
// funds, there is probably moving funds to our wallet in the process.
// Our wallet is on the list of target wallets. If the state of the
// source wallet is still MovingFunds, the moving funds process
// targeting our wallet is likely in progress.
walletChainData, err := chain.GetWallet(event.WalletPublicKeyHash)
if err != nil {
return false, fmt.Errorf(