-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unlock transaction inputs if tx cannot be published #1404
Conversation
In some cases, funding a tx will work but publishing may fail (because mempool fees are not met for example). In that case we need to make sure that the tx inputs are unlocked.
eclair-core/src/test/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWalletSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWallet.scala
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWallet.scala
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWallet.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWallet.scala
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWallet.scala
Show resolved
Hide resolved
Reformat `unlockOutpoints`, and consider that if Bitcoin Core returned `expected locked output` then unlocking was successful.
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWallet.scala
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWallet.scala
Show resolved
Hide resolved
We check that unlocking outpoints that are not locked is considered successful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have done it as an even simpler test in ExtendedBitcoinClientSpec
but why not.
eclair-core/src/test/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWalletSpec.scala
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWalletSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWalletSpec.scala
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWalletSpec.scala
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWalletSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWalletSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/bitcoind/BitcoinCoreWallet.scala
Outdated
Show resolved
Hide resolved
…/BitcoinCoreWalletSpec.scala Co-authored-by: Pierre-Marie Padiou <pm47@users.noreply.github.com>
…/BitcoinCoreWalletSpec.scala Co-authored-by: Pierre-Marie Padiou <pm47@users.noreply.github.com>
…/BitcoinCoreWalletSpec.scala Co-authored-by: Pierre-Marie Padiou <pm47@users.noreply.github.com>
…/BitcoinCoreWalletSpec.scala Co-authored-by: Pierre-Marie Padiou <pm47@users.noreply.github.com>
…/BitcoinCoreWalletSpec.scala Co-authored-by: Pierre-Marie Padiou <pm47@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I verified that when the special case for the "expected locked output" is commented out, the test indeed fails.
In some cases, funding a tx will work but publishing it may fail (because mempool fees are not met for example). In that case we need to make sure that the tx inputs, which were locked by
fundrawtransaction
, are unlocked.