nayutaco / ptarmigan

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

bitcoinj: `paytowallet` need commit_tx confirmation. #1514

Closed nayuta-ueno closed 5 years ago

nayuta-ueno commented 5 years ago

After unilateral close, to_local, to_remote and HTLC outputs save to wallet DB. ptarmcli --paytowallet pay from wallet DB to Bitcoin blockchain spending some confirmation. But, getting confirmation from TXID is difficult for bitcoinj.

wallet DB保存する際にminingされたblock countも保存するようにし、現在のblock countからconfirmationを計算するように変更する。 ただ、これはbitcoinjのみの対応とし、bitcoindについてはgetrawtransactionからconfirmationが取得できるため現状のままとする。

DBバージョンも1つ上げる。 bitcoind版は自動的に継続、bitcoinj版はwallet DBでconfirmationを確認する必要がない場合に自動継続する。bitcoinj版でconfirmationを確認する場合は起動不可。

そのせいで実装としてはbitcoindとbitcoinjに分かれてしまうが、致し方あるまい。