Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
While experimenting with miniscript expressions on regtest (on commit a43f08c4ae) with the cli, I imported a descriptor with the older
fragment:
wsh(and_v(v:older(2),pk(tprv8ZgxMBicQKsPe5EVQ3cw3S1GdWyKxTeVvgVujejwFgJYGPucrUyPhsR2Zd4ngq3QSfB4HehpXqSPtwdoV7b8JYunU2kPai1AWUUxvb5gkrf/84h/1h/0h/1/*)))#tcaf9v8u
After sending money to an address made from this descriptor using sendtoaddress
with an amount, I received the error message:
0error code: -6
1error message:
2Signing transaction failed
After stepping through the code in debug mode I found it was failing on the following line within CheckSequence
:
const int64_t txToSequence = (int64_t)txTo->vin[nIn].nSequence;
This is because the nSequence on the input isn’t being set according to the value specified in older
.
The easy workaround to this is to use createrawtransaction
and manually set nSequence
Expected behaviour
The expected behavior is a transaction is made with the descriptor-locked input. I’m split between labeling this as a bug or feature request, but chose to file as a bug because the wallet has everything it needs to spend the input. Please reclassify this as a feature request if you do find it fits better with that label.
Steps to reproduce
- Create a new wallet
- Import the descriptor and derive an address:
0export desc="wsh(and_v(v:older(2),pk(tprv8ZgxMBicQKsPe5EVQ3cw3S1GdWyKxTeVvgVujejwFgJYGPucrUyPhsR2Zd4ngq3QSfB4HehpXqSPtwdoV7b8JYunU2kPai1AWUUxvb5gkrf/84h/1h/0h/1/*)))#tcaf9v8u"
1export descriptors="[{\"desc\":\"$desc\",\"timestamp\":\"now\"}]"
2b importdescriptors $descriptors
3b deriveaddresses $desc "[1,1]"
- Send money to the generated address from another wallet
- Generate 3 blocks
- Switch back to the wallet with the above descriptor and try to send funds out
Relevant log output
No response
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
master@a43f08c4ae
Operating system and version
Ubuntu
Machine specifications
No response