add test to demonstrate pair of "half" kernels sharing same public excess (#3314)

* cleanup how we handle key splitting for transaction offset
add test to demonstrate a pair of transaction halves sharing same kernel excess

* cleanup

* cleanup
This commit is contained in:
Antioch Peverell
2020-05-28 15:26:18 +01:00
committed by GitHub
parent b570ac9925
commit a8b8dc3a7f
4 changed files with 170 additions and 88 deletions
+7 -1
View File
@@ -29,6 +29,7 @@ use grin_util as util;
use std::cmp::Reverse;
use std::collections::{HashMap, HashSet};
use std::sync::Arc;
use util::static_secp_instance;
pub struct Pool<B, V>
where
@@ -272,7 +273,12 @@ where
header: &BlockHeader,
) -> Result<BlockSums, PoolError> {
let overage = tx.overage();
let offset = (header.total_kernel_offset() + tx.offset.clone())?;
let offset = {
let secp = static_secp_instance();
let secp = secp.lock();
header.total_kernel_offset().add(&tx.offset, &secp)
}?;
let block_sums = self.blockchain.get_block_sums(&header.hash())?;