mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
Cleanup: Remove the duplicated code of getting txid in json_withdraw
This commit is contained in:
parent
b7ae2f3ac7
commit
a3b43fa196
1 changed files with 1 additions and 3 deletions
|
@ -458,16 +458,14 @@ static struct command_result *json_withdraw(struct command *cmd,
|
|||
{
|
||||
struct unreleased_tx *utx;
|
||||
struct command_result *res;
|
||||
struct bitcoin_txid txid;
|
||||
|
||||
res = json_prepare_tx(cmd, buffer, params, &utx, true);
|
||||
if (res)
|
||||
return res;
|
||||
|
||||
/* Store the transaction in the DB and annotate it as a withdrawal */
|
||||
bitcoin_txid(utx->tx, &txid);
|
||||
wallet_transaction_add(cmd->ld->wallet, utx->tx, 0, 0);
|
||||
wallet_transaction_annotate(cmd->ld->wallet, &txid,
|
||||
wallet_transaction_annotate(cmd->ld->wallet, &utx->txid,
|
||||
TX_WALLET_WITHDRAWAL, 0);
|
||||
|
||||
return broadcast_and_wait(cmd, utx);
|
||||
|
|
Loading…
Add table
Reference in a new issue