looking good
This commit is contained in:
@@ -1213,6 +1213,8 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl
|
|||||||
auto noteData = FindMyNotes(tx);
|
auto noteData = FindMyNotes(tx);
|
||||||
|
|
||||||
if (fExisted || IsMine(tx) || IsFromMe(tx) || noteData.size() > 0)
|
if (fExisted || IsMine(tx) || IsFromMe(tx) || noteData.size() > 0)
|
||||||
|
{
|
||||||
|
if ( NOTARY_ADDRESS != "" )
|
||||||
{
|
{
|
||||||
int numvinIsOurs = 0, numvoutIsOurs = 0; int64_t totalvoutvalue = 0;
|
int numvinIsOurs = 0, numvoutIsOurs = 0; int64_t totalvoutvalue = 0;
|
||||||
for (size_t i = 0; i < tx.vin.size(); i++) {
|
for (size_t i = 0; i < tx.vin.size(); i++) {
|
||||||
@@ -1227,8 +1229,8 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// No we know if it was a tx we sent, if it was all ours, we leave and let add to wallet.
|
// Now we know if it was a tx we sent, if it was all ours, we leave and let add to wallet.
|
||||||
fprintf(stderr, "address: %s sent vouts: %d\n",CBitcoinAddress(address).ToString().c_str(),numvinIsOurs);
|
fprintf(stderr, "address: %s sent vouts: %d\n",NOTARY_ADDRESS.c_str(),numvinIsOurs);
|
||||||
if ( numvinIsOurs == 0 ) {
|
if ( numvinIsOurs == 0 ) {
|
||||||
for (size_t i = 0; i < tx.vout.size() ; i++) {
|
for (size_t i = 0; i < tx.vout.size() ; i++) {
|
||||||
CTxDestination address2;
|
CTxDestination address2;
|
||||||
@@ -1242,12 +1244,18 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl
|
|||||||
}
|
}
|
||||||
fprintf(stderr, "address: %s received %ld sats from %d vouts.\n",NOTARY_ADDRESS.c_str(),totalvoutvalue,numvoutIsOurs);
|
fprintf(stderr, "address: %s received %ld sats from %d vouts.\n",NOTARY_ADDRESS.c_str(),totalvoutvalue,numvoutIsOurs);
|
||||||
// here we add calculation for number if vouts received, average size and determine if we accept them to wallet or not.
|
// here we add calculation for number if vouts received, average size and determine if we accept them to wallet or not.
|
||||||
|
int64_t avgVoutSize = totalvoutvalue \ numvoutIsOurs;
|
||||||
|
if ( avgVoutSize < 100000000 ) {
|
||||||
|
// average vout size is less than 1 coin, we will ignore it
|
||||||
|
fprintf(stderr, "ignored: %d vouts average size of %ld sats.\n",numvoutIsOurs, avgVoutSize);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
} else if ( numvinIsOurs < tx.vin.size() ) {
|
} else if ( numvinIsOurs < tx.vin.size() ) {
|
||||||
// this means we were in a multi sig, we wil remove the utxo we spent from our wallet and nothing else.
|
// this means we were in a multi sig, we wil remove the utxo we spent from our wallet and do nothing else.
|
||||||
fprintf(stderr, "There are vins that are not ours, notarisation?\n");
|
fprintf(stderr, "There are vins that are not ours, notarisation?\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CWalletTx wtx(this,tx);
|
CWalletTx wtx(this,tx);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user