CreateNewBlock: Leave more space for Orchard shielded coinbase
This commit is contained in:
parent
05a1c41aac
commit
f789229a33
|
@ -345,12 +345,17 @@ BlockAssembler::BlockAssembler(const CChainParams& _chainparams)
|
||||||
nBlockMinSize = std::min(nBlockMaxSize, nBlockMinSize);
|
nBlockMinSize = std::min(nBlockMaxSize, nBlockMinSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockAssembler::resetBlock()
|
void BlockAssembler::resetBlock(const MinerAddress& minerAddress)
|
||||||
{
|
{
|
||||||
inBlock.clear();
|
inBlock.clear();
|
||||||
|
|
||||||
// Reserve space for coinbase tx
|
// Reserve space for coinbase tx
|
||||||
nBlockSize = 1000;
|
// nBlockMaxSize already includes 1000 bytes for transaction structure overhead.
|
||||||
|
nBlockSize = std::visit(match {
|
||||||
|
[](const libzcash::OrchardRawAddress&) { return 9000; },
|
||||||
|
[](const libzcash::SaplingPaymentAddress&) { return 1000; },
|
||||||
|
[](const boost::shared_ptr<CReserveScript> &) { return 1000; },
|
||||||
|
}, minerAddress);
|
||||||
nBlockSigOps = 100;
|
nBlockSigOps = 100;
|
||||||
|
|
||||||
// These counters do not include coinbase tx
|
// These counters do not include coinbase tx
|
||||||
|
@ -370,7 +375,7 @@ CBlockTemplate* BlockAssembler::CreateNewBlock(
|
||||||
const MinerAddress& minerAddress,
|
const MinerAddress& minerAddress,
|
||||||
const std::optional<CMutableTransaction>& next_cb_mtx)
|
const std::optional<CMutableTransaction>& next_cb_mtx)
|
||||||
{
|
{
|
||||||
resetBlock();
|
resetBlock(minerAddress);
|
||||||
|
|
||||||
pblocktemplate.reset(new CBlockTemplate());
|
pblocktemplate.reset(new CBlockTemplate());
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ public:
|
||||||
private:
|
private:
|
||||||
// utility functions
|
// utility functions
|
||||||
/** Clear the block's state and prepare for assembling a new block */
|
/** Clear the block's state and prepare for assembling a new block */
|
||||||
void resetBlock();
|
void resetBlock(const MinerAddress& minerAddress);
|
||||||
/** Add a tx to the block */
|
/** Add a tx to the block */
|
||||||
void AddToBlock(CTxMemPool::txiter iter);
|
void AddToBlock(CTxMemPool::txiter iter);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue