aboutsummaryrefslogtreecommitdiff
path: root/src/psbt.h
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2020-03-26 11:18:52 +0100
committerSjors Provoost <sjors@sprovoost.nl>2020-03-27 14:59:19 +0100
commit764bfe4cba35c24f7627cc425d9e7eba56e98964 (patch)
treeba28bee5ce038c9b3e40805cd07d1caffe26322d /src/psbt.h
parent1cd8dc2556b847e11a238b9e69493cd8fbeecc6c (diff)
[psbt] add file size limit
Diffstat (limited to 'src/psbt.h')
-rw-r--r--src/psbt.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/psbt.h b/src/psbt.h
index dfba261961..7ea06b38f7 100644
--- a/src/psbt.h
+++ b/src/psbt.h
@@ -40,6 +40,10 @@ static constexpr uint8_t PSBT_OUT_BIP32_DERIVATION = 0x02;
// as a 0 length key which indicates that this is the separator. The separator has no value.
static constexpr uint8_t PSBT_SEPARATOR = 0x00;
+// BIP 174 does not specify a maximum file size, but we set a limit anyway
+// to prevent reading a stream indefinately and running out of memory.
+const std::streamsize MAX_FILE_SIZE_PSBT = 100000000; // 100 MiB
+
/** A structure for PSBTs which contain per-input information */
struct PSBTInput
{