Skip to content

Commit 19f12af

Browse files
committed
fix(rpc): detach coinbase cache when overriding miner params
1 parent 0bcdcbf commit 19f12af

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

zebra-rpc/src/methods/types/get_block_template.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,10 @@ where
693693
/// address on a cloned handler, without changing the configured default.
694694
pub fn set_miner_params(&mut self, miner_params: MinerParams) {
695695
self.miner_params = Some(miner_params);
696+
// Cached coinbases pay the previous miner address, and this handler shares
697+
// its cache with the handler it was cloned from. Detach to a fresh cache so
698+
// neither handler can serve a coinbase built for the other's address.
699+
self.coinbase_cache = CoinbaseCache::default();
696700
}
697701

698702
/// Returns a handle to the coinbase transaction cache.

0 commit comments

Comments
 (0)