Skip to content

[MultiSig] Ensure that input consolidation tx is always built.#507

Merged
fassadlr merged 1 commit intostratisproject:masterfrom
fassadlr:fix-inputconsol
Apr 8, 2021
Merged

[MultiSig] Ensure that input consolidation tx is always built.#507
fassadlr merged 1 commit intostratisproject:masterfrom
fassadlr:fix-inputconsol

Conversation

@fassadlr
Copy link
Contributor

@fassadlr fassadlr commented Apr 8, 2021

Currently, the multisig is going into a build input consolidation loop. This is the scenario:

  1. An withdrawal tx is built that has more than 50 inputs
  2. Input consolidation gets triggered
  3. Input consolidation "fails" cause of the threshold amount being reached within the first loop already:

if (oneRound.Sum(x => x.Transaction.Amount) >= amount + FederatedPegSettings.ConsolidationFee)

  1. A consolidation tx is never built due to the above.
  2. The method exits and we go back to point 1.
  3. The node is now stuck in a infinite loop of trying to build the consolidation tx.

The fix here is that we always need to build the consolidation tx first and THEN check the threshold amount.

Copy link
Contributor

@noescape00 noescape00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@quantumagi quantumagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fassadlr fassadlr merged commit d9b26f9 into stratisproject:master Apr 8, 2021
@fassadlr fassadlr deleted the fix-inputconsol branch April 8, 2021 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants