Skip to content

Commit

Permalink
Workaround NBitcoin txout shuffling bug
Browse files Browse the repository at this point in the history
NBitcoin's TransactionBuilder.ShuffleOutputs flag is broken and gets
ignored when building the Transaction. This can be worked around by
setting the TransactionBuilder's RandomShuffle field to null, which
disables all random shuffling.

This fix can be removed once NBitcoin bug #931 is fixed:

See:
MetacoSA/NBitcoin#931
  • Loading branch information
canndrew committed Oct 28, 2020
1 parent 0c2bda2 commit d813a97
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/DotNetLightning.Core/Transactions/Transactions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ module Transactions =
let txb = network.CreateTransactionBuilder()
txb.ShuffleOutputs <- false
txb.ShuffleInputs <- false
txb.ShuffleRandom <- null
txb

let UINT32_MAX = 0xffffffffu
Expand Down

0 comments on commit d813a97

Please sign in to comment.