File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,13 @@ class BlockTemplate
4242 virtual CTransactionRef getCoinbaseTx () = 0;
4343 virtual std::vector<unsigned char > getCoinbaseCommitment () = 0;
4444 virtual int getWitnessCommitmentIndex () = 0;
45+
46+ /* *
47+ * Compute merkle path to the coinbase transaction
48+ *
49+ * @return merkle path ordered from the deepest
50+ */
51+ virtual std::vector<uint256> getCoinbaseMerklePath () = 0;
4552};
4653
4754// ! Interface giving clients (RPC, Stratum v2 Template Provider in the future)
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ interface BlockTemplate $Proxy.wrap("interfaces::BlockTemplate") {
3131 getCoinbaseTx @4 (context: Proxy.Context) -> (result: Data);
3232 getCoinbaseCommitment @5 (context: Proxy.Context) -> (result: Data);
3333 getWitnessCommitmentIndex @6 (context: Proxy.Context) -> (result: Int32);
34+ getCoinbaseMerklePath @7 (context: Proxy.Context) -> (result: List(Data));
3435}
3536
3637struct BlockCreateOptions $Proxy.wrap("node::BlockCreateOptions" ) {
Original file line number Diff line number Diff line change 88#include < chain.h>
99#include < chainparams.h>
1010#include < common/args.h>
11+ #include < consensus/merkle.h>
1112#include < consensus/validation.h>
1213#include < deploymentstatus.h>
1314#include < external_signer.h>
@@ -910,6 +911,11 @@ class BlockTemplateImpl : public BlockTemplate
910911 return GetWitnessCommitmentIndex (m_block_template->block );
911912 }
912913
914+ std::vector<uint256> getCoinbaseMerklePath () override
915+ {
916+ return BlockMerkleBranch (m_block_template->block );
917+ }
918+
913919 const std::unique_ptr<CBlockTemplate> m_block_template;
914920};
915921
You can’t perform that action at this time.
0 commit comments