coins: update API surface for creating coin movements

Canonicalize the signature for the 'tag-type' of coin moves by unique
constructor/method calls.

Suggested-By: @rustyrussell
This commit is contained in:
lisa neigut
2020-04-14 22:08:06 -05:00
committed by Rusty Russell
parent aab9893661
commit de065580f6
10 changed files with 462 additions and 235 deletions

View File

@@ -341,9 +341,9 @@ static void onchain_add_utxo(struct channel *channel, const u8 *msg)
outpointfilter_add(channel->peer->ld->wallet->owned_outpoints, &u->txid, u->outnum);
wallet_add_utxo(channel->peer->ld->wallet, u, p2wpkh);
mvt = new_chain_coin_mvt_sat(msg, "wallet", &u->txid, &u->txid,
u->outnum, NULL, blockheight,
DEPOSIT, u->amount, true, BTC);
mvt = new_coin_deposit_sat(msg, "wallet", &u->txid,
u->outnum, blockheight,
u->amount, BTC);
notify_chain_mvt(channel->peer->ld, mvt);
}