From 25b2674fd613b784429bc3a7e7fe7fe0748ba44a Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Fri, 7 Jun 2019 11:41:28 +0200 Subject: [PATCH] Expose pegin confirmation depth parameter via getsidechaininfo --- src/rpc/blockchain.cpp | 2 ++ test/functional/feature_fedpeg.py | 1 + 2 files changed, 3 insertions(+) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 385398dec6..fbc15a2412 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2415,6 +2415,7 @@ UniValue getsidechaininfo(const JSONRPCRequest& request) " \"parent_chain_signblockscript_asm\": \"xxxx\", (string) If the parent chain has signed blocks, its signblockscript in ASM.\n" " \"parent_chain_signblockscript_hex\": \"xxxx\", (string) If the parent chain has signed blocks, its signblockscript in hex.\n" " \"parent_pegged_asset\": \"xxxx\", (boolean) If the parent chain has Confidential Assets, the asset id of the pegged asset in that chain.\n" + " \"pegin_confirmation_depth\": x.xx (numeric) The number of mainchain confirmations required for a peg-in transaction to become valid.\n" " \"enforce_pak\": \"xxxx\", (boolean) If peg-out authorization is being enforced.\n" "}\n" }, @@ -2436,6 +2437,7 @@ UniValue getsidechaininfo(const JSONRPCRequest& request) obj.pushKV("parent_blockhash", parent_blockhash.GetHex()); obj.pushKV("parent_chain_has_pow", consensus.ParentChainHasPow()); obj.pushKV("enforce_pak", Params().GetEnforcePak()); + obj.pushKV("pegin_confirmation_depth", (uint64_t)consensus.pegin_min_depth); if (!consensus.ParentChainHasPow()) { obj.pushKV("parent_chain_signblockscript_asm", ScriptToAsmStr(consensus.parent_chain_signblockscript)); obj.pushKV("parent_chain_signblockscript_hex", HexStr(consensus.parent_chain_signblockscript)); diff --git a/test/functional/feature_fedpeg.py b/test/functional/feature_fedpeg.py index 584ad54e7c..4405111b64 100755 --- a/test/functional/feature_fedpeg.py +++ b/test/functional/feature_fedpeg.py @@ -187,6 +187,7 @@ class FedPegTest(BitcoinTestFramework): assert_equal(sidechain.decodescript(addrs["claim_script"])["type"], "witness_v0_keyhash") txid1 = parent.sendtoaddress(addr, 24) # 10+2 confirms required to get into mempool and confirm + assert_equal(sidechain.getsidechaininfo()["pegin_confirmation_depth"], 10) parent.generate(1) time.sleep(2) proof = parent.gettxoutproof([txid1])