Skip to content

Conversation

@achow101
Copy link
Member

The sendall RPC would previously fail when used with a watchonly wallet and specified inputs. This failure was caused by checking isminetype equality with ISMINE_ALL rather than a bitwise AND as IsMine can never return ISMINE_ALL.

Also added a test.

sendall should be using a bitwise AND for sendall's IsMine check rather
than an equality as IsMine will never return ISMINE_ALL.
@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #25375 (rpc: add minconf/maxconf options to sendall and fund transaction calls by ishaanam)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@fanquake
Copy link
Member

Does this need backporting?

@achow101
Copy link
Member Author

Does this need backporting?

Yes

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK d442101d

With an extra crash finding that doesn't necessarily need to be included here.

@achow101 achow101 force-pushed the fix-sendall-watchonly branch from d442101 to 315fd4d Compare October 20, 2022 17:26
Copy link
Contributor

@w0xlt w0xlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 315fd4d

Commits can be squashed.

@achow101
Copy link
Member Author

Commits can be squashed.

I prefer to keep implementation separate from test so that tests can be easily cherry-picked onto master to verify that they fail.

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 315fd4d

@fanquake fanquake merged commit 085f839 into bitcoin:master Oct 21, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 23, 2022
…pecified inputs

315fd4d test: Test for out of bounds vout in sendall (Andrew Chow)
b132c85 wallet: Check utxo prevout index out of bounds in sendall (Andrew Chow)
708b72b test: Test that sendall works with watchonly spending specific utxos (Andrew Chow)
6bcd7e2 wallet: Correctly check ismine for sendall (Andrew Chow)

Pull request description:

  The `sendall` RPC would previously fail when used with a watchonly wallet and specified inputs. This failure was caused by checking isminetype equality with ISMINE_ALL rather than a bitwise AND as IsMine can never return ISMINE_ALL.

  Also added a test.

ACKs for top commit:
  w0xlt:
    ACK bitcoin@315fd4d
  furszy:
    ACK 315fd4d

Tree-SHA512: fb55cf6524e789964770b803f401027319f0351433ea084ffa7c5e6f1797567a608c956b7f7c5bd542aa172c4b7b38b07d0976f5ec587569efead27266e8664c
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Oct 28, 2022
sendall should be using a bitwise AND for sendall's IsMine check rather
than an equality as IsMine will never return ISMINE_ALL.

Github-Pull: bitcoin#26344
Rebased-From: 6bcd7e2
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Oct 28, 2022
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Oct 28, 2022
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Oct 28, 2022
@fanquake fanquake mentioned this pull request Oct 28, 2022
@fanquake
Copy link
Member

Backported in #26410.

fanquake added a commit that referenced this pull request Oct 31, 2022
d570190 rpc: make `address` field optional (w0xlt)
e4b8c9b rpc: add non-regression test about deriveaddresses crash when index is 2147483647 (muxator)
bf2bf73 rpc: fix crash in deriveaddresses when derivation index is 2147483647 (muxator)
b04f5f9 test: Test for out of bounds vout in sendall (Andrew Chow)
dedee6a wallet: Check utxo prevout index out of bounds in sendall (Andrew Chow)
931db78 test: Test that sendall works with watchonly spending specific utxos (Andrew Chow)
bbe864a wallet: Correctly check ismine for sendall (Andrew Chow)
4b7d30d Adjust `.tx/config` for new Transifex CLI (Hennadii Stepanov)

Pull request description:

  Backports:
  * #26321
  * #26344
  * #26275
  * #26349

ACKs for top commit:
  instagibbs:
    ACK d570190
  hebasto:
    ACK d570190, I've cherry-picked commits manually and got zero diff with this PR branch.

Tree-SHA512: dad64f4074b4f06d666c0f2d804eda92df241bcce0a49c28486311a151f2e9d46b75e1bce02de570dcc85957c9ce936debb2a4faa045800c9757c6c495115d7c
@bitcoin bitcoin locked and limited conversation to collaborators Oct 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants