Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
Lint: Code style violation: '/Users/shammah/repos/bitcoin-abc/src/wallet/wallet.cpp' has code style errors. | |||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include "wallet/wallet.h" | #include "wallet/wallet.h" | ||||
#include "base58.h" | #include "base58.h" | ||||
#include "chain.h" | #include "chain.h" | ||||
▲ Show 20 Lines • Show All 886 Lines • ▼ Show 20 Lines | bool CWallet::AccountMove(std::string strFrom, std::string strTo, | ||||
} | } | ||||
int64_t nNow = GetAdjustedTime(); | int64_t nNow = GetAdjustedTime(); | ||||
// Debit | // Debit | ||||
CAccountingEntry debit; | CAccountingEntry debit; | ||||
debit.nOrderPos = IncOrderPosNext(&walletdb); | debit.nOrderPos = IncOrderPosNext(&walletdb); | ||||
debit.strAccount = strFrom; | debit.strAccount = strFrom; | ||||
debit.nCreditDebit = -nAmount; | debit.nCreditDebit = -1 * nAmount; | ||||
debit.nTime = nNow; | debit.nTime = nNow; | ||||
debit.strOtherAccount = strTo; | debit.strOtherAccount = strTo; | ||||
debit.strComment = strComment; | debit.strComment = strComment; | ||||
AddAccountingEntry(debit, &walletdb); | AddAccountingEntry(debit, &walletdb); | ||||
// Credit | // Credit | ||||
CAccountingEntry credit; | CAccountingEntry credit; | ||||
credit.nOrderPos = IncOrderPosNext(&walletdb); | credit.nOrderPos = IncOrderPosNext(&walletdb); | ||||
▲ Show 20 Lines • Show All 1,842 Lines • ▼ Show 20 Lines | assert(txNew.nLockTime < LOCKTIME_THRESHOLD); | ||||
// The coin age after the next block (depth+1) is used instead | // The coin age after the next block (depth+1) is used instead | ||||
// of the current, reflecting an assumption the user would | // of the current, reflecting an assumption the user would | ||||
// accept a bit more delay for a chance at a free transaction. | // accept a bit more delay for a chance at a free transaction. | ||||
// But mempool inputs might still be in the mempool, so their | // But mempool inputs might still be in the mempool, so their | ||||
// age stays 0. | // age stays 0. | ||||
int age = pcoin.first->GetDepthInMainChain(); | int age = pcoin.first->GetDepthInMainChain(); | ||||
assert(age >= 0); | assert(age >= 0); | ||||
if (age != 0) age += 1; | if (age != 0) age += 1; | ||||
dPriority += (double)nCredit * age; | dPriority += (double)(age * nCredit); | ||||
} | } | ||||
const CAmount nChange = nValueIn - nValueToSelect; | const CAmount nChange = nValueIn - nValueToSelect; | ||||
if (nChange > 0) { | if (nChange > 0) { | ||||
// Fill a vout to ourself. | // Fill a vout to ourself. | ||||
// TODO: pass in scriptChange instead of reservekey so change | // TODO: pass in scriptChange instead of reservekey so change | ||||
// transaction isn't always pay-to-bitcoin-address. | // transaction isn't always pay-to-bitcoin-address. | ||||
CScript scriptChange; | CScript scriptChange; | ||||
▲ Show 20 Lines • Show All 1,712 Lines • Show Last 20 Lines |
'/Users/shammah/repos/bitcoin-abc/src/wallet/wallet.cpp' has code style errors.