This fix guarantees a callback if there is a pending request rather than just
dropping the fee request.
When requestFee() is called the callbacks are added to a list of callBacks.
Once the next fee request completes all callbacks in the list are called
and the list cleared.
Update the two new indices on every known write to the list, namely addBlock() and addBlocks(). Restrict ability to modify the blocks list outside of these methods by overwriting the getBlocks() getter such that it returns an unmodifiable list.
In the process of migrating the server to a new instance, my secret key
for the onion address seems to have become corrupted. Therefore, I
needed to generate a new onion address.
There have been 1 tx in cycle 17 and 2 txs in cycle 23 which have been confirmed outside of the phase.
The vote result had excluded it correctly but for the hash calculation for the blind vote monitor the
phase check was missing which results in an incorrect hash.
By fixing that the past hashes back to cycle 17 are all invalid. Once all seed nodes are running that
patch nodes should be in sync again. As it did not affect consensus but only the monitoring it is not
critical.
Move consecutive maybeAddSegwitKeychain(..) calls for the BTC & BSQ
wallets from BisqSetup to WalletsManager, as the latter class is used
for operations which should be applied to both wallets and this moves
the logic closer to the wallet domain.
Also migrate a BSQ address validator in one of the test mock classes
from Base58AddressValidator to BitcoinAddressValidator (missed earlier).
Uncomment & enable the m/44'/142'/1' native segwit BSQ account path and
add code to migrate the user's BSQ wallet to segwit upon startup, along
the same lines as the existing BTC wallet segwit migration logic. That
is, set P2WPKH as the default output type, add a native segwit key chain
(set to active) to the BSQ wallet and back up the old 'bisq_BSQ.wallet'
file to 'pre_segwit_bisq_BSQ.wallet.backup'.
Also filter out legacy addresses coming from the original keychain from
BsqWalletService.get(Unused|Change)Address.
Remove the restriction to base58 (P2SH & P2PKH) addresses when parsing,
formatting & validating BSQ addresses, by replacing o.b.c.LegacyAddress
with its superclass o.b.c.Address throughout. Also remove restriction to
LegacyAddress in BsqTxListItem and BsqTransfer(Service|Model).
The bech32 BSQ addresses follow the same format as the old base58 BSQ
addresses, namely 'B' + <btc-address>.
Use flatMap(Optional::stream) instead of filter(..isPresent).map(..get)
and avoid a redundantly nested Optional in OpReturnType.
Also replace some unnecessary stream().forEach(..) invocations on lists
in BtcWalletService, as forEach is already part of the List interface.
- Finished API server's verify bsq payment impl.
- Added verifybsqsenttoaddress method to CLI.
- Added verifybsqsenttoaddress-help.txt to server.
- Fixed client getoffers, getmyoffers to work with BSQ offers.
- Added bool tradeInstant field to proto message def.
- Adjusted core createcryptopaymentacct impl to new tradeInstant request param.
- Adjusted cli side createcryptopaymentacct impl to new tradeInstant request param.
- Fixed CliMain's takeoffer help text (was missing the --payment-account opt).
This change adds offer and trade contract detail to the API's Offer
and Trade protos, and improves CLI output formatting.
- Appended missing fields to OfferInfo proto message:
uint64 sellerSecurityDeposit = 20;
string offerFeePaymentTxId = 21;
uint64 txFee = 22;
uint64 makerFee = 23;
- Added new api proto messages ContractInfo and PaymentAccountPayloadInfo.
Lighterweight protos are needed because core Trade/Contract classes are
not visible to CLI.
- Appended ContractInfo field to api proto message TradeInfo.
- Added proto / model converters for ContractInfo and PaymentAccountPayloadInfo,
and adjusted OfferInfo & TradeInfo.
- Improved CLI output formatting. Added more trade detail to CLI's gettrade output,
and prepared to support BTC/BSQ trading pair. Note a reviewer is advised to
look at the CLI outout formatting class files instead getting bogged down in the
many commit changes.
This change supports creation of BSQ BLOCKCHAIN payment method accounts.
- Added proto message defs to grpc.proto.
- Added grpc server boilerplate to GrpcPaymentAccountsService.
- Added server impl to CoreApi, CorePaymentAccountsService.
- Added createcryptopaymentacct-help.txt.
- Added CLI side support for new api method.
- Added opt parsing unit tests to OptionParsersTest.
This is the 1st PR in a series, with the goal of supporting the BTC/BSQ trading
pair. Support for other crypto currency payment accounts will be added later.
This change sets the WalletsManager key the first time `unlockwallet` is called.
This is necessary because the key cannot be set during api daemon startup, as it
normally is at UI startup. See commit eb15fda229.
Running the UI's walletPasswordHandler during wallet initialization will fail
and block wallet initialization. This change ensures an encrypted wallet
does not trigger a walletPasswordHandler.run() if isApiUser=true during startup.
Push back the (2nd) DAO hard fork activation block height to 680300,
which is 4 weeks after the planned 1.6.0 release around 2021/03/25.
(Also push back the testnet block activation height to 1943000 - 2 weeks
from now assuming an average block time of 10 minutes.)
This change sets the WalletsManager key the first time `unlockwallet` is called.
This is necessary because the key cannot be set during api daemon startup, as it
normally is at UI startup. See commit eb15fda229.
Running the UI's walletPasswordHandler during wallet initialization will fail
and block wallet initialization. This change ensures an encrypted wallet
does not trigger a walletPasswordHandler.run() if isApiUser=true during startup.
This change uses recently added walletService.isAddressUnused to ensure
the api's CoreWalletsService creates an unused address if none exists.
- grpc.proto: Add bool isAddressUnused field to message AddressBalanceInfo.
- AddressBalanceInfo: Adjust AddressBalanceInfo proto wrapper.
- CoreWalletsService: Use walletService.isAddressUnused in getFundingAddresses.
- GrpcClient: Adjust to modified AddressBalanceInfo.
- TableFormat, ColumnHeaderConstants: Add 'Is Used' column to getfundingaddresses output.
Note: bugfix is out of scope for this PR, but the test case helped expose this bug.
- Add description msg TakeOfferReply proto, and fromProto method
to core.offer.enum AvailabilityResult. The description field
maps a client usable error message to the enum.
- Adjust GrpcErrorMessageHandler to add AvailabilityResult.description()
to takeoffer reply.
- Refactor (split up) GrpcClient's takeOffer. Add getTakeOfferReply()
to give clients a chance to make choices based on the reply's
AvailabilityResult when the takeoffer command did not result in a
trade. (Some errors are fatal, some not.)
- GrpcErrorMessageHandler A new ErrorMessageHandler implementation
to get around the api specific problem of having to use Task
ErrorMessageHandlers that build task error messages for the UI.
- GrpcExceptionHandler A new method for working with the
ErrorMessageHandler interface.
- GrpcTradesService, CoreApi, CoreTradesService: Ajdusted takeoffer
error handling to give a failure reason provided by the new
GrpcErrorMessageHandler.
Make it clear the user needs to enter a two letter country code
in json form's "country" field, not a country name.
The json form's field name was not changed to "countryCode" in
this change for the following reason:
The API's payment account forms are dynamically generated using
reflection, and PaymentAccount class hierarchy @Setter methods
determine which form fields are included or excluded. Reflection
and @Setter methods are also used when reading completed json
forms, to set the field values on a new PaymentAccount instance
before it is persisted.
CountryBasedPaymentAccount subclasses have a country field and a
@Setter, not a countryCode field, hence this shortcut to informing
the user the country field value is a country-code.
Make it clear the user needs to enter a two letter country code
in json form's "country" field, not a country name.
The json form's field name was not changed to "countryCode" in
this change for the following reason:
The API's payment account forms are dynamically generated using
reflection, and PaymentAccount class hierarchy @Setter methods
determine which form fields are included or excluded. Reflection
and @Setter methods are also used when reading completed json
forms, to set the field values on a new PaymentAccount instance
before it is persisted.
CountryBasedPaymentAccount subclasses have a country field and a
@Setter, not a countryCode field, hence this shortcut to informing
the user the country field value is a country-code.