Skip to content

Conversation

@DashCoreAutoGuix
Copy link
Owner

Backport Summary

This PR backports Bitcoin Core PR bitcoin#26094 (commit da9f62f912) which adds block hash and height information to wallet RPC responses.

Changes

Bitcoin commit: da9f62f912 (May 2, 2023)
Original PR: bitcoin#26094

The backport adds lastprocessedblock field containing block hash and height to the following RPC endpoints:

  • getbalances - Returns balance information with block context
  • gettransaction - Returns transaction details with block context
  • getwalletinfo - Returns wallet state with block context

Dash-Specific Adaptations

  1. Preserved Dash wallet fields: Maintained Dash-specific fields in getwalletinfo including:

    • coinjoin_balance in balance fields
    • hdchainid, hdaccountcount, hdaccounts for HD wallet structure
    • timefirstkey, keys_left for key management
  2. Skipped external_signer: Bitcoin's external_signer feature is not present in Dash, so this field was not added to getwalletinfo.

  3. Test adaptations:

    • Updated wallet_basic.py to expect lastprocessedblock field while preserving Dash-specific fields (chainlock, instantlock)
    • Updated wallet_orphanedreward.py to handle lastprocessedblock in balance comparisons while keeping Dash's coinjoin field

Implementation Details

Added helper function AppendLastProcessedBlock() in src/wallet/rpc/util.cpp that appends block hash and height to RPC response objects. This function is called at the end of:

  • getbalances() in src/wallet/rpc/coins.cpp
  • gettransaction() in src/wallet/rpc/transactions.cpp
  • getwalletinfo() in src/wallet/rpc/wallet.cpp

Testing

Functional tests updated to handle the new lastprocessedblock field in RPC responses.

Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

…gettransaction and getwalletinfo

710b839 rpc: return block hash & height in getbalances, gettransaction & getwalletinfo JSONs (Harris)

Pull request description:

  Reopens bitcoin#18570 and closes bitcoin#18567.
  I have rebased the original PR.
  Not sure why the original got closed as it was about to get merged.

ACKs for top commit:
  achow101:
    ACK 710b839

Tree-SHA512: d4478d990be98b1642e9ffb2930987f4a224e8bd64e2e35a5dda927a54c509ec9d712cd0eac35dc2bb89f00a1678e530ce14d7445f1dd93aa3a4cce2bc9b130d
@coderabbitai
Copy link

coderabbitai bot commented Sep 30, 2025

Warning

Rate limit exceeded

@DashCoreAutoGuix has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 39 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 54e2588 and 7febdb9.

📒 Files selected for processing (9)
  • doc/release-notes-26094.md (1 hunks)
  • src/wallet/rpc/coins.cpp (2 hunks)
  • src/wallet/rpc/transactions.cpp (2 hunks)
  • src/wallet/rpc/util.cpp (1 hunks)
  • src/wallet/rpc/util.h (3 hunks)
  • src/wallet/rpc/wallet.cpp (2 hunks)
  • test/functional/wallet_balance.py (3 hunks)
  • test/functional/wallet_basic.py (1 hunks)
  • test/functional/wallet_orphanedreward.py (1 hunks)
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch backport-0.25-batch-415-pr-26094

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants