Skip to content

Commit 9e70a2f

Browse files
committed
instance: input vout index vs tx vin index mess-up (again)
1 parent 8d59b80 commit 9e70a2f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

instance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ bool Instance::setup_environment(unsigned int flags) {
188188
if (tx) {
189189
if (txin && txin_index > -1) {
190190
std::vector<CTxOut> spent_outputs;
191-
spent_outputs.emplace_back(txin->vout[txin_index]);
191+
spent_outputs.emplace_back(txin->vout[txin_vout_index]);
192192
if (tx->vin.size() == 1) {
193193
txdata.Init(*tx.get(), std::move(spent_outputs), has_preamble);
194194
}

instance.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ class Instance {
2222
ECCVerifyHandle evh;
2323
CTransactionRef tx;
2424
CTransactionRef txin;
25+
/*
26+
* INPUT TX VOUT TX VIN
27+
* [0] [0]* <-- txin_index==0
28+
* [1]* [1]
29+
* `-- txin_vout_index==1
30+
*/
2531
int64_t txin_index; ///< index of the input txid in tx's inputs
2632
int64_t txin_vout_index; ///< index inside txin of the output to tx
2733
std::vector<CAmount> amounts;

0 commit comments

Comments
 (0)