Skip to content

Fix masternode collateral vin validation#9

Open
NateIsern wants to merge 1 commit into
mainfrom
codex/propose-fix-for-masternode-collateral-issue
Open

Fix masternode collateral vin validation#9
NateIsern wants to merge 1 commit into
mainfrom
codex/propose-fix-for-masternode-collateral-issue

Conversation

@NateIsern

Copy link
Copy Markdown
Member

Motivation

  • Prevent a collateral validation bug that accepted unowned outputs by scanning any output in the funding transaction and by using a 4999.99 FAIR dummy threshold instead of ensuring the referenced outpoint is the exact 5000 FAIR collateral output.

Description

  • Require the referenced vin.prevout.n output itself to match MASTER_NODE_AMOUNT * COIN and pay to the collateral pubkey by changing IsVinAssociatedWithPubkey() to inspect txVin.vout[vin.prevout.n] instead of scanning all outputs. (src/obfuscation.cpp)
  • Restore the dummy collateral checks to use the exact MASTER_NODE_AMOUNT * COIN amount instead of 4999.99 * COIN in masternode liveness, broadcast admission, and legacy dsee paths. (src/masternode.cpp, src/masternodeman.cpp)
  • Commit message: Fix masternode collateral vin validation.

Testing

  • Ran git diff --check with no issues reported. (succeeded)
  • Attempted ./autogen.sh in this environment and it failed due to missing aclocal (environment dependency), so a full build/test could not be executed here. (failed due to environment)
  • Verified the modified lines via repository search (rg) and inspected the resulting diffs to confirm the intended changes were applied. (inspection only)

Codex Task

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant