// Sets hashProofOfStake on success return
bool CheckStakeKernelHash(unsigned int nBits, const CBlock& blockFrom, unsigned int nTxPrevOffset, const CTransaction& txPrev, const COutPoint& prevout, unsigned int nTimeTx, uint256& hashProofOfStake, uint256& targetProofOfStake, bool fPrintProofOfStake=false);
-// Preloaded coins set
-typedef set<pair<const CWalletTx*,unsigned int> > CoinsSet;
-
-// Preloaded coins metadata (block header and stake modifier)
-typedef map<uint256, pair<CTxIndex, pair<CBlock, uint64> > > MetaMap;
-
// Coins scanning options
typedef struct KernelSearchSettings {
unsigned int nBits; // Packed difficulty
unsigned int nSearchInterval; // Number of seconds allowed to go into the past
} KernelSearchSettings;
+typedef std::set<std::pair<const CWalletTx*,unsigned int> > CoinsSet;
+
+// Preloaded coins metadata
+// txid => ((txindex, (tx, vout.n)), (block, modifier))
+typedef std::map<uint256, std::pair<std::pair<CTxIndex, std::pair<const CWalletTx*,unsigned int> >, std::pair<CBlock, uint64> > > MetaMap;
+
// Scan given coins set for kernel solution
-bool ScanForStakeKernelHash(CoinsSet &setCoins, MetaMap &mapMeta, KernelSearchSettings &settings, CoinsSet::value_type &kernelcoin, unsigned int &nTimeTx, unsigned int &nBlockTime);
+bool ScanForStakeKernelHash(MetaMap &mapMeta, KernelSearchSettings &settings, CoinsSet::value_type &kernelcoin, unsigned int &nTimeTx, unsigned int &nBlockTime);
// Check kernel hash target and coinstake signature
// Sets hashProofOfStake on success return