package Ġorg . know ledger . ledger . chain . service Ċ Ċ import Ġorg . know ledger . ledger . chain . Chain Info Ċ import Ġorg . know ledger . ledger . chain . data . W itness Reference Ċ import Ġorg . know ledger . ledger . storage . Mutable Coin base Ċ Ċ class ĠCoin base ServiceImpl Ġ: ĠCoin base Service Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġre calculate Mer kle Tree ( ĊĠĠĠĠĠĠĠ Ġcoin base : ĠMutable Coin base , Ġreference : ĠW itness Reference , Ġtx Index : ĠInt , Ġchain Info : ĠChain Info , ĊĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcoin base . mer kle Tree . apply Single Diff ( coin base . wit nesses [ reference . index ], Ġtx Index ) ĊĠĠĠĠĠĠĠ Ġcoin base . coin base Header . update Mer kle Root ( coin base . mer kle Tree . hash ) ĊĠĠĠĠĠĠĠ Ġval Ġnew Hash Ġ= Ġcoin base . coin base Header . digest ( chain Info . hash ers , Ġchain Info . encoder ) ĊĠĠĠĠĠĠĠ Ġcoin base . coin base Header . update Hash ( new Hash ) ĊĠĠĠ Ġ} Ċ }