Box value encoded in a variant to reduce enum stack space
before ``` print-type-size type: `util::psbt::error::Error`: 120 bytes, alignment: 8 bytes print-type-size discriminant: 1 bytes print-type-size variant `CombineInconsistentKeySources`: 115 bytes print-type-size padding: 3 bytes print-type-size field `.0`: 112 bytes, alignment: 4 bytes print-type-size variant `InvalidKey`: 39 bytes print-type-size padding: 7 bytes print-type-size field `.0`: 32 bytes, alignment: 8 bytes ``` after ``` print-type-size type: `util::psbt::error::Error`: 40 bytes, alignment: 8 bytes print-type-size discriminant: 1 bytes print-type-size variant `InvalidKey`: 39 bytes print-type-size padding: 7 bytes print-type-size field `.0`: 32 bytes, alignment: 8 bytes print-type-size variant `DuplicateKey`: 39 bytes print-type-size padding: 7 bytes print-type-size field `.0`: 32 bytes, alignment: 8 bytes ```
This commit is contained in:
parent
491da3e701
commit
9906cea14c
|
@ -80,7 +80,7 @@ pub enum Error {
|
||||||
},
|
},
|
||||||
/// Conflicting data during combine procedure:
|
/// Conflicting data during combine procedure:
|
||||||
/// global extended public key has inconsistent key sources
|
/// global extended public key has inconsistent key sources
|
||||||
CombineInconsistentKeySources(ExtendedPubKey),
|
CombineInconsistentKeySources(Box<ExtendedPubKey>),
|
||||||
/// Serialization error in bitcoin consensus-encoded structures
|
/// Serialization error in bitcoin consensus-encoded structures
|
||||||
ConsensusEncoding,
|
ConsensusEncoding,
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,7 @@ impl PartiallySignedTransaction {
|
||||||
entry.insert((fingerprint1, derivation1));
|
entry.insert((fingerprint1, derivation1));
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return Err(Error::CombineInconsistentKeySources(xpub));
|
return Err(Error::CombineInconsistentKeySources(Box::new(xpub)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue