mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
wallet: fuzz the nLockTime added to withdraw transactions
This commit is contained in:
parent
273029f244
commit
a589daa235
@ -10,6 +10,7 @@
|
||||
#include <common/jsonrpc_errors.h>
|
||||
#include <common/key_derive.h>
|
||||
#include <common/param.h>
|
||||
#include <common/pseudorand.h>
|
||||
#include <common/status.h>
|
||||
#include <common/utils.h>
|
||||
#include <common/utxo.h>
|
||||
@ -288,9 +289,11 @@ static struct command_result *json_prepare_tx(struct command *cmd,
|
||||
* native segwit, nlocktime set to tip, and sequence set to
|
||||
* 0xFFFFFFFE by default. Other wallets are likely to implement
|
||||
* this too).
|
||||
* FIXME: Do we want to also fuzz this like bitcoind does ?
|
||||
*/
|
||||
locktime = cmd->ld->topology->tip->height;
|
||||
/* Eventually fuzz it too. */
|
||||
if (pseudorand(10) == 0)
|
||||
locktime -= (u32)pseudorand(100);
|
||||
}
|
||||
|
||||
if (!feerate_per_kw) {
|
||||
|
Loading…
Reference in New Issue
Block a user