Skip to content

Commit 64e9332

Browse files
committed
(squash) add comment about format of params
1 parent 557f7db commit 64e9332

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/chainparams.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ void ParseSignetParams(const std::vector<uint8_t>& params, CChainParams::SigNetO
7070
return;
7171
}
7272

73+
// The format of params is extendable in case more fields are added in the future.
74+
// It is encoded as a concatenation of (field_id, value) tuples, protobuf style.
75+
// Currently there is only one field defined: pow_target_spacing, whose field_id
76+
// is 0x01 and the lendth of encoding is 8 (int64_t). So valid values of params are:
77+
// - empty string (checked in if block above),
78+
// - 0x01 followed by 8 bytes of pow_target_spacing (9 bytes in total).
79+
// If length is not 0 and not 9, the value can not be parsed.
80+
7381
if (params.size() != 1 + 8) {
7482
throw std::runtime_error(strprintf("signet params must have length %d, got %d.", 1+8, params.size()));
7583
}

0 commit comments

Comments
 (0)