nayutaco / ptarmigan

Lightning Network (BOLT)
Apache License 2.0
132 stars 19 forks source link

to_remote append wallet DB once #1519

Closed nayuta-ueno closed 5 years ago

nayuta-ueno commented 5 years ago

received HTLC outputを持つcommit_txをremoteが展開(remote unilateral close)された場合、

  1. funding_txのspentを確認→wallet DBにto_remote outputを登録
  2. ptarmcli --paytowallet=1でto_remoteをspentする
  3. しばらく置いてminingされる

その後でptarmcli --paytowalletを実行してwallet DBを見ると、またto_remoteが追加されている。

nayuta-ueno commented 5 years ago

1514 でunspentチェックをコメントアウトしたのが原因ではないのか?

https://github.com/nayutaco/ptarmigan/blob/2a2771a789ade3df1080f71cb945a4ef54b75a49/ptarmd/wallet.c#L229-L237

nayuta-ueno commented 5 years ago

bitcoinjでテストエラーになるが、bitcoindを優先して前の変更を元に戻す。