Skip to content

Commit

Permalink
use just one tx and reverse the witness hash
Browse files Browse the repository at this point in the history
  • Loading branch information
humblenginr committed Apr 11, 2024
1 parent ddeb838 commit 1e496f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ func UpdateValidTxns() {
}
}

var TemporaryValidTxn = []string{
"000cb561188c762c81f76976f816829424e2af9e0e491c617b7bf41038df3d35.json",
}

var TemporaryValidTxns = []string{
"000cb561188c762c81f76976f816829424e2af9e0e491c617b7bf41038df3d35.json",
"001035505afbf143e51bd667099190943a38eee20092bb691e72eaa44992b2f7.json",
Expand Down Expand Up @@ -109,7 +113,7 @@ func SelectTransactionsFromPaths(validTxnPaths []string) []*txn.Transaction {

func main() {
UpdateValidTxns()
txns := SelectTransactionsFromPaths(TemporaryValidTxns)
txns := SelectTransactionsFromPaths(TemporaryValidTxn)
candidateBlock := mining.GetCandidateBlock(txns, true)
mining.MineBlock(candidateBlock, OutputFilePath)
}
2 changes: 1 addition & 1 deletion src/transaction/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (t Transaction) WitnessHash() []byte {
}
bytes := w.Bytes()
txhash := utils.DoubleHash(bytes)
return txhash
return utils.ReverseBytes(txhash)
}

func (input Vin) GetScriptType() ScriptPubKeyType {
Expand Down

0 comments on commit 1e496f0

Please sign in to comment.