breez / breez-sdk-greenlight

MIT License
241 stars 42 forks source link

Node shows an onchain utxo ready for sweep but was already swept #591

Closed roeierez closed 10 months ago

roeierez commented 11 months ago

Version

Description

sdk> node_info
{
  "id": "039643057ea8af7e3ed538d240ec538c27ba99744ca9bee7e7ace74899ac73c298",
  "block_height": 805356,
  "channels_balance_msat": 0,
  "onchain_balance_msat": 0,
  "utxos": [
    {
      "txid": [
        121,
        107,
        122,
        115,
        252,
        58,
        69,
        170,
        80,
        241,
        43,
        97,
        57,
        157,
        240,
        163,
        13,
        223,
        9,
        159,
        47,
        189,
        48,
        108,
        77,
        165,
        199,
        216,
        250,
        59,
        144,
        165
      ],
      "outnum": 1,
      "amount_millisatoshi": 224175000,
      "address": "bc1qk9gphu3la9ya8w3ue6xypw69zqk0vnager4jfp",
      "reserved": true
    }
  ],
  "max_payable_msat": 0,
  "max_receivable_msat": 4000000000,
  "max_single_payment_amount_msat": 4294967000,
  "max_chan_reserve_msats": 0,
  "connected_peers": [
    "02c811e575be2df47d8b48dab3d3f1c9b0f6e16d0d40b5ed78253308fc2bd7170d"
  ],
  "inbound_liquidity_msats": 0
}
roeierez commented 10 months ago

I think we should unreserve the output before sweeping as a mechanism also to rebroadcast with higher fees.

roeierez commented 10 months ago

duplicate with https://github.com/breez/breez-sdk/issues/531

dangeross commented 9 months ago

The lagging comment seems to link to https://github.com/Blockstream/greenlight/issues/347 maybe?

roeierez commented 9 months ago

Could be, yes. Regardless I think we need to apply this logic (unreserve before sweep). It should allow re-broadcast with updated fees while the tx is in mempool.