offline tool: add wire-fee cmd

This commit is contained in:
swrup 2026-02-03 22:03:25 +01:00
parent 6ee1a994ad
commit 17be86bfd4
5 changed files with 111 additions and 21 deletions

View file

@ -407,8 +407,19 @@ module Wire_fee = struct
match wire_fees with
| [] ->
let+ () = Pg.insert_wire_fee db_conn v |> unwrap_err_caqti in
Logs.info (fun m -> m "added wire fee");
()
| _l -> Error "wire-fee already setup"
| [ vv ] -> (
match v.master_sig_wire = vv.sig_ with
| false ->
Error "a different wire-fee was already setup for this time frame"
| true ->
Logs.info (fun m -> m "an identical wire-fee was already setup");
Ok ())
| _ ->
Error
"invalid database state, multiple wire-fee found in database for \
this time frame"
let jsont = WireFeeSetupMessage.jsont