mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:42:38 +00:00
Receive reserves an address when its tab is shown: Addresses lists it unmarked, the next request replaces a label typed there, and Set password does not drop it #1129
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1129
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Showing the Receive tab reserves one address for the next payment request without printing it. That address is listed in Wallet settings → Addresses like any other unused address, a label typed on it there is replaced by the next request's Note to self, and it survives Set password, so the first request after a password is set uses an address from the seed Core has just retired.
To reproduce:
Bob depositon it.Carol invoice 17, Create payment request.The request is on the address from step 2, and Core's label for it is now
Carol invoice 17. Receive showed neither the address nor the existing label before saving.encryptwalletin the console / with a restart before the requestIf the listed address is given to someone and a request is created before that person pays, two payers share it: a 0.1 BTC payment turned the 1 BTC request into "Payment received" with no QR, and after the second payer Core had 1.1 BTC and two transactions on the address. That status rule is in my comment on #1058; what is new is how two people come to hold the address.
After the password,
listdescriptorshas the 8 old descriptors inactive and 8 new ones active, and the first request is atm/86h/1h/0h/0/0of the old fingerprint. Nothing is lost, but a wallet file copied before the password can also spend a payment to that address: a restored pre-password backup owned it, and not the second request's address. So my steps on #709 hold only if Receive was not shown first; I did not re-run them the other way.The reservation is made, or restored from settings, whenever Receive becomes visible; the next request is bound to it; and a non-empty note is written over the address-book label:
github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/models/walletqmlmodel.cpp (L1218-L1255)github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/models/walletqmlmodel.cpp (L1272-L1289)github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/models/walletqmlmodel.cpp (L1398-L1406)Core alone never returns an address twice, and its first
getnewaddressafterencryptwalletis from the new seed. Bitcoin-Qt, by its source, asks for the address at the click. Since #958 was closed nothing displays the reserved address, so could it be requested at Create payment request instead? Related: #1085, #972, #971, #1041, #914, #931.Reproduced on
qt6at2bd5a61e8304, macOS arm64 / Qt 6.9.0, isolated regtest, offscreen and native; the counts include offscreen runs ateed1f426fcb6. Clicks and field text went through the test bridge, not by hand, and the label was committed through it in place of Return. I did not copy the address from Addresses; by the source its text is a button that copies it. Payments, and all wallets but one, came over RPC. The spend from the pre-password copy was not executed. Bech32m only.