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
42
42
virtual CTransactionRef getCoinbaseTx () = 0;
43
43
virtual std::vector<unsigned char > getCoinbaseCommitment () = 0;
44
44
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;
45
52
};
46
53
47
54
// ! 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") {
31
31
getCoinbaseTx @4 (context: Proxy.Context) -> (result: Data);
32
32
getCoinbaseCommitment @5 (context: Proxy.Context) -> (result: Data);
33
33
getWitnessCommitmentIndex @6 (context: Proxy.Context) -> (result: Int32);
34
+ getCoinbaseMerklePath @7 (context: Proxy.Context) -> (result: List(Data));
34
35
}
35
36
36
37
struct BlockCreateOptions $Proxy.wrap("node::BlockCreateOptions" ) {
Original file line number Diff line number Diff line change 8
8
#include < chain.h>
9
9
#include < chainparams.h>
10
10
#include < common/args.h>
11
+ #include < consensus/merkle.h>
11
12
#include < consensus/validation.h>
12
13
#include < deploymentstatus.h>
13
14
#include < external_signer.h>
@@ -910,6 +911,11 @@ class BlockTemplateImpl : public BlockTemplate
910
911
return GetWitnessCommitmentIndex (m_block_template->block );
911
912
}
912
913
914
+ std::vector<uint256> getCoinbaseMerklePath () override
915
+ {
916
+ return BlockMerkleBranch (m_block_template->block );
917
+ }
918
+
913
919
const std::unique_ptr<CBlockTemplate> m_block_template;
914
920
};
915
921
You can’t perform that action at this time.
0 commit comments