mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Use type-safe txid types in orphanage
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <arith_uint256.h>
|
||||
#include <primitives/transaction.h>
|
||||
#include <pubkey.h>
|
||||
#include <script/sign.h>
|
||||
#include <script/signingprovider.h>
|
||||
@@ -29,8 +30,8 @@ public:
|
||||
CTransactionRef RandomOrphan() EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
|
||||
{
|
||||
LOCK(m_mutex);
|
||||
std::map<uint256, OrphanTx>::iterator it;
|
||||
it = m_orphans.lower_bound(InsecureRand256());
|
||||
std::map<Txid, OrphanTx>::iterator it;
|
||||
it = m_orphans.lower_bound(Txid::FromUint256(InsecureRand256()));
|
||||
if (it == m_orphans.end())
|
||||
it = m_orphans.begin();
|
||||
return it->second.tx;
|
||||
|
||||
Reference in New Issue
Block a user