Skip to content

Commit

Permalink
Add is_pegin response for raw transaction RPCs
Browse files Browse the repository at this point in the history
  • Loading branch information
instagibbs committed Nov 6, 2017
1 parent d4d00da commit 6534bd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qa/rpc-tests/pegging.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ def sync_all(sidechain, sidechain2):
else:
raise Exception("Peg-in confirmation has failed.")

# Look at pegin fields
decoded = sidechain.decoderawtransaction(tx1["hex"])
assert decoded["vin"][0]["is_pegin"] == True
assert len(decoded["vin"][0]["pegin_witness"]) > 0

# Quick reorg checks of pegs
sidechain.invalidateblock(blockhash[0])
if sidechain.gettransaction(pegtxid1)["confirmations"] != 0:
Expand Down
1 change: 1 addition & 0 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
o.push_back(Pair("asm", ScriptToAsmStr(txin.scriptSig, true)));
o.push_back(Pair("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())));
in.push_back(Pair("scriptSig", o));
in.push_back(Pair("is_pegin", txin.m_is_pegin));
}
if (tx.HasWitness()) {
UniValue scriptWitness(UniValue::VARR);
Expand Down

0 comments on commit 6534bd3

Please sign in to comment.